package top.shiyiri.spring5.factorybean;

import org.springframework.beans.factory.FactoryBean;
import top.shiyiri.spring5.bean.Book;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Aunean
 * @date 2022/2/17 13:44
 */
public class MyBean implements FactoryBean<Book> {

    //定义返回bean
    @Override
    public Book getObject() throws Exception {
        Book book = new Book();
        List<String> list = new ArrayList<>();
        list.add("sdfs");
        list.add("sdfs2");
        book.setList(list);
        return book;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }
}
